package com.hourse.platform.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @使用描述: Params
 */
public class SqlParams {

  private StringBuffer sql = new StringBuffer();

  private Map<String,Object> paramsMap = new HashMap<>();

  public static SqlParams New(){
    return new SqlParams();
  }

  public SqlParams add(String key, Object val){
    this.paramsMap.put(key,val);
    return this;
  }

  public SqlParams append(String sql){
    this.sql.append(sql);
    return this;
  }

  public Map getParams(){

    return paramsMap;
  }

  public void reset(){
    paramsMap.clear();
    sql.setLength(0);
  }

  public String getSql(){

    return sql.toString();
  }
}
